import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'getStatus'
})
export class GetStatusPipe implements PipeTransform {

  transform(value: string, args?: any): string {
    switch (value) {
      case 'Y': return '激活';
      case 'N': return '未激活';
    }
  }
};
@Pipe({
  name: 'showType'
})
export class ShowTypePipe implements PipeTransform {

  transform(value: string, args?: any): string {
    switch (value) {
      case '0': return '<font style="color:red">正常</font>';
      case '1': return '未激活';
      case '2': return '未激活';
    }
  }
};

@Pipe({
  name: 'getOrderStatus'
})
export class GetOrderStatusPipe implements PipeTransform {

  transform(value: string, args?: any): string {
    switch (value) {
      case 'Y': return '已支付';
      case 'N': return '未支付';
      case 'PENDING': return '待支付';
      case 'CANCELED': return '已取消';
      case 'REJECTED': return '被拒绝';
      case 'EXPIRED': return '订单过期';
      case 'PAID': return '方案设计中';
      case 'PREPARING': return '行程已告知';
      case 'COMPLETED': return '订单完成';
    }
  }
};

@Pipe({
  name: 'getTansactionStatus'
})
export class GetTransactionStatusPipe implements PipeTransform {

  transform(value: string, args?: any): string {
    switch (value) {
      case 'PAID': return '已支付';
      case 'N': return '未支付';
      case 'PENDING': return '等待中';
      case 'TRAVEL_ORDER': return '旅行订单';
      case 'WITHDRAWAL': return '提币';
      case 'DEPOSIT': return '充值';
    }
  }
};